package cn.schoolwow.quickflow.service.flowContext.execute;

import cn.schoolwow.quickflow.QuickFlowExecutor;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import cn.schoolwow.quickflow.flow.CompositeBusinessFlow;

public interface FlowContextExecuteOperation {
    /**
     * 中断当前流程
     * @param reason 中断原因
     */
    void brokenCurrentFlow(String reason);

    /**
     * 中断当前复合流程
     * @param reason 中断原因
     */
    void brokenCurrentCompositeBusiness(String reason);

    /**
     * 中断流程
     * @param reason 中断原因
     */
    void broken(String reason);

    /**
     * 创建流程
     * */
    QuickFlowExecutor startFlow(String name);

    /**
     * 创建流程
     * */
    QuickFlowExecutor startFlow(BusinessFlow businessFlow);

    /**
     * 创建流程
     * */
    QuickFlowExecutor startFlow(CompositeBusinessFlow compositeBusinessFlow);

    /**
     * 执行内部函数
     */
    FlowContext executeFunctionFlowList(String... functionFlowNames);

    /**
     * 执行流程列表
     */
    FlowContext executeFlowList(BusinessFlow... businessFlowList);

    /**
     * 执行复合流程列表
     */
    FlowContext executeCompositeFlowList(CompositeBusinessFlow... compositeBusinessFlowList);
}
